<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.7.1.js"></script>
    <link href="../../style/authority/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="../../style/authority/common_style.css" rel="stylesheet" type="text/css">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
    <link href="../../css/bootstrap.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap.js"></script>
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap-table.js"></script>
    <script type="text/javascript" src="../../scripts/bootstrap/bootstrap-table-zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="../../style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
    <script type="text/javascript" src="../../scripts/artDialog/artDialog.js?skin=default"></script>
    <title>问题反馈管理</title>
    <script type="text/javascript">
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
            if (r != null) return unescape(r[2]);
            return null;
        }

        var myname = GetQueryString("name");

        function MyQuestion() {
            /* $.ajax({
                 url: "/Question/FindQuestionByName", //处理页面的路径
                 data: {name: myname},//要提交的数据是一个JSON
                 type: "POST", //提交方式
                 //TEXT字符串 JSON返回JSON XML返回XML
                 success: function (data) { //回调函数 ,成功时返回的数据存在形参data里
                     var item;
                     var items = '';
                     items += "<tr><th style='width: 5%;'>" + "反馈编号" + "</th><th style='width:6%;'>" +"用户名"+"</th><th style='width: 5%;'>"+ "姓名" + "</th><th style='width: 5%;'>" + "类型" + "</th><th style='width: 5%;'>"+ "版本" +"</th><th style='width: 5%;'>"+ "反馈主题" + "</th><th style='width: 24%'>" + "反馈内容"+ "</th><th style='width: 17%;'>" +"反馈时间"+ "</th><th style='width: 17%;'>"+"BUG地址"+ "</th><th style='width: 5%;'>"+"处理状态"+"</th></tr>";
                     $.each(data, function (i, result) {
                         item = "<tr><td>" + result['tid'] + "</td><td>" + result['useraccount']+"</td><td>" + result['username'] + "</td><td>" + result['type'] + "</td><td>" + result['version'] + "</td><td>" + result['title'] + "</td><td>" + result['content'] + "</td><td>" + result['posttime'] + "</td><td>" +result['bugurl']+"</td><td>"+ result['status'] + "</td></tr>";
                         items += item;
                     });
                     $('#usertable').html(items);
                 }
             });*/
            $.ajaxSettings.async = false;
            $("#question_table").bootstrapTable('destroy');
            $('#question_table').bootstrapTable({
                url: "/Question/FindQuestionByName",
                method: 'post',
                contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
                cache: false,
                queryParams: queryParams,
                striped: true,
                pagination: true,
                sortable: true,
                sortOrder: "desc",
                sortName: "posttime",
                sidePagination: 'client',
                pageSize: 10,
                pageNumber: 1,
                pageList: [10, 20, 50, 100, 200, 500],
                search: true,
                strictSearch: false,
                showColumns: true,
                showRefresh: false,
                showExport: false,
                uniqueId: "uid",
                showToggle: false,
                cardView: false,
                // clickToSelect: true,
                //  showFooter:true,
                columns:
                    [
                        // {field: "checked", checkbox: true},
                        {field: "tid", title: "反馈编号", align: "center", valign: "middle", sortable: "true"},
                        {field: "useraccount", title: "用户名", align: "center", valign: "middle", sortable: "true"},
                        {field: "username", title: "姓名", align: "center", valign: "middle", sortable: "true"},
                        {field: "type", title: "类型", align: "center", valign: "middle", sortable: "true"},
                        {field: "version", title: "版本", align: "center", valign: "middle", sortable: "true"},
                        {field: "title", title: "主题", align: "center", valign: "middle", sortable: "true"},
                        {
                            field: "content",
                            title: "内容",
                            width: 220,
                            align: "center",
                            valign: "middle",
                            sortable: "true"
                        },
                        {field: "posttime", title: "时间", align: "center", valign: "middle", sortable: "true"},
                        {field: "bugurl", title: "BUG地址", align: "center", valign: "middle", sortable: "true",},
                        {field: "status", title: "处理状态", align: "center", valign: "middle", sortable: "true",},
                    ],
                onLoadSuccess:function (data) {
                    if(data.code!=null){if(data.code=400)window.parent.location.href="/login.html";}
                }

            });

            function queryParams(params) {
                return {
                    name: myname,
                }
            }


        }
    </script>
    <style>
        .alt td {
            background: black !important;
        }
    </style>
</head>
<body onload="getDate01()">
<div id="container">
    <div class="ui_content">
        <div class="ui_text_indent">
            <div id="box_border">
                <div id="box_top">反馈信息</div>

                <div id="box_bottom">
                    <table id="question_table" class="table" cellspacing="0" cellpadding="0" width="100%" align="center"
                           border="0"></table>
                    <script>
                        MyQuestion();
                    </script>
                </div>
            </div>

        </div>
    </div>
    <div class="ui_tb">
    </div>
    <div class="ui_content">
        <div class="ui_tb_h30">
            <div class="ui_flt" style="height: 30px; line-height: 30px;">

            </div>
            <div class="ui_frt">

            </div>
        </div>
    </div>
</div>
</body>
</html>
